<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>class</title>
</head>
<body>
    <div id="app"></div>

    <div id="App"></div>

    <script src="./1.js"></script>
    <script src="./2.js"></script>
    <script src="./3.js"></script>

    <script type="text/babel">

class Name extends React.Component{
            constructor(){
                super();
            }

            render(){
                // console.log(this)// 当前组件
                console.log(this.props);
                return  <h1>{this.props.t}</h1>
            }
        }

        function Names(u) {
            return <h1>{u.t}</h1>
        }

        ReactDOM.render(
            <div>
                <Name t='科学'></Name>
                <Name t='信息'></Name>
            </div>,
            document.getElementById('app')
        )

        ReactDOM.render(
            <div>
                <Name t='科学信息'></Name>
                <Name t='信息科学'></Name>
            </div>,
            document.getElementById('App')
        )

        class Biaoti extends  React.Component{
            constructor(){
                super();
            }

            render(){
                // console.log(this)// 当前组件
                console.log(this.props);
                return  <h1>{this.props.t}</h1>
            }
        }

        ReactDOM.render(
            <div>
                <Biaoti t="推荐课程"></Biaoti> 
                <Biaoti t="优秀老师"></Biaoti> 
            </div>,
            document.getElementById("App")
        )
    </script>


</body>
</html>